package com.thinqq.web.client.content.handler;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.thinqq.web.client.content.painter.IContentPainter;
import com.thinqq.web.client.content.painter.InformationTechnologyContentPainter;

public class LinkClickHandler implements ClickHandler {
	private IContentPainter painter;
	private HorizontalPanel mainContent;
	private VerticalPanel relatedContent;

	public LinkClickHandler(IContentPainter painter,
			HorizontalPanel mainContent, VerticalPanel relatedContent) {
		super();
		this.painter = painter;
		this.mainContent = mainContent;
		this.relatedContent = relatedContent;
	}
	@Override
	public void onClick(ClickEvent event) {
		if (painter == null) {
			painter = new InformationTechnologyContentPainter();
		}
		if (mainContent != null && relatedContent!=null) {
			painter.updateConent(mainContent,relatedContent);
		}
	}

}
